#ifndef QATTRIBUTEEDITOR_H
#define QATTRIBUTEEDITOR_H

#include "corelib_global.h"

#include <QWidget>
#include <QComboBox>
#include <QSpinBox>
#include <QLineEdit>

class QDriveAttribute;
class QDriveValueMap;

class CORELIBSHARED_EXPORT QAttributeEnumEditor: public QComboBox
{
    Q_OBJECT
public:
    QAttributeEnumEditor(QDriveAttribute* property,QWidget *parent=0);
protected slots:
    void setPropertyValue(int value);
protected:
    QDriveAttribute   *m_property;
};

class CORELIBSHARED_EXPORT QAttributeLineEditEditor: public QLineEdit
{
    Q_OBJECT
public:
    QAttributeLineEditEditor(QDriveAttribute* property,QWidget *parent=0);
protected slots:
    void setPropertyValue();
protected:
    QDriveAttribute   *m_property;
};

class CORELIBSHARED_EXPORT QAttributeIntEditor: public QSpinBox
{
    Q_OBJECT
public:
    QAttributeIntEditor(QDriveAttribute* property,QWidget *parent=0);

protected slots:
    void setPropertyValue();
protected:
    QDriveAttribute   *m_property;
};



class CORELIBSHARED_EXPORT QValueIntEditor: public QSpinBox
{
    Q_OBJECT
public:
    QValueIntEditor(QDriveValueMap *value,int row,int column,QWidget *parent);

protected slots:
    void setPropertyValue();
protected:
    QDriveValueMap *m_value;
    int             m_row;
    int             m_column;
};

class CORELIBSHARED_EXPORT QValueEnumEditor: public QComboBox
{
    Q_OBJECT
public:
    QValueEnumEditor(QDriveValueMap *value,int row,int column,QWidget *parent=0);
protected slots:
    void setPropertyValue(int value);
protected:
    QDriveValueMap *m_value;
    int             m_row;
    int             m_column;
};

class CORELIBSHARED_EXPORT QValueLineEditEditor: public QLineEdit
{
    Q_OBJECT
public:
    QValueLineEditEditor(QDriveValueMap *value,int row,int column,QWidget *parent=0);
protected slots:
    void setPropertyValue();
protected:
    QDriveValueMap *m_value;
    int             m_row;
    int             m_column;
};

class CORELIBSHARED_EXPORT QValueMemeryEditor: public QComboBox
{
    Q_OBJECT
public:
    QValueMemeryEditor(QDriveValueMap *value,int row,int column,QWidget *parent=0);
protected slots:
    void setPropertyValue(int value);
protected:
    QDriveValueMap *m_value;
    int             m_row;
    int             m_column;
};

class CORELIBSHARED_EXPORT QEditorCreator
{
public:
    virtual  QWidget* createAttributeEditor(QDriveAttribute* attr,QWidget* parent);
    virtual  QWidget* createValueEditor(QDriveValueMap *value,QWidget *parent,int row,int column);
};

#endif // QATTRIBUTEEDITOR_H
